#!/usr/bin python3
# -*- coding:UTF-8 -*-
# Author: nigo
import plotly.express as px

# 数据
df = px.data.iris()
# 创建Figure对象（图+画布）
# fig = px.scatter(df, x="sepal_width", y="sepal_length",title='鸢尾花散点图')
fig = px.scatter(df, x="sepal_width", y="sepal_length",title='鸢尾花散点图', color="species",
                 size='petal_length', hover_data=['petal_width'],
                color_discrete_sequence=px.colors.qualitative.Vivid,
                 color_discrete_map={'setosa':'red'})
# 显示画布
fig.show()
